3.501 \(\int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^2} \, dx\)

Optimal. Leaf size=86 \[ \frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}}-\frac {b \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))} \]

[Out]

2*a*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(3/2)/(a+b)^(3/2)/d-b*tan(d*x+c)/(a^2-b^2)/d/(a+
b*sec(d*x+c))

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3833, 12, 3831, 2659, 208} \[ \frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}}-\frac {b \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]/(a + b*Sec[c + d*x])^2,x]

[Out]

(2*a*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/((a - b)^(3/2)*(a + b)^(3/2)*d) - (b*Tan[c + d*x])/(
(a^2 - b^2)*d*(a + b*Sec[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rule 2659

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[(2*e)/d, Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}
, x] && NeQ[a^2 - b^2, 0]

Rule 3831

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[1/b, Int[1/(1 + (a*Sin[e
 + f*x])/b), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 3833

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> -Simp[(b*Cot[e + f*x]*(a
 + b*Csc[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 - b^2)), x] + Dist[1/((m + 1)*(a^2 - b^2)), Int[Csc[e + f*x]*(a +
b*Csc[e + f*x])^(m + 1)*(a*(m + 1) - b*(m + 2)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^
2, 0] && LtQ[m, -1] && IntegerQ[2*m]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^2} \, dx &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {\int \frac {a \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{-a^2+b^2}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {a \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^2-b^2}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {a \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{b \left (a^2-b^2\right )}\\ &=-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {(2 a) \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right ) d}\\ &=\frac {2 a \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}-\frac {b \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 83, normalized size = 0.97 \[ \frac {\frac {b \sin (c+d x)}{(b-a) (a+b) (a \cos (c+d x)+b)}-\frac {2 a \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]/(a + b*Sec[c + d*x])^2,x]

[Out]

((-2*a*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]])/(a^2 - b^2)^(3/2) + (b*Sin[c + d*x])/((-a + b)*(a
 + b)*(b + a*Cos[c + d*x])))/d

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 332, normalized size = 3.86 \[ \left [-\frac {{\left (a^{2} \cos \left (d x + c\right ) + a b\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d\right )}}, \frac {{\left (a^{2} \cos \left (d x + c\right ) + a b\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d}\right ] \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="fricas")

[Out]

[-1/2*((a^2*cos(d*x + c) + a*b)*sqrt(a^2 - b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2*sqr
t(a^2 - b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^2 + 2*a*b*cos(d*x + c) + b^2))
 + 2*(a^2*b - b^3)*sin(d*x + c))/((a^5 - 2*a^3*b^2 + a*b^4)*d*cos(d*x + c) + (a^4*b - 2*a^2*b^3 + b^5)*d), ((a
^2*cos(d*x + c) + a*b)*sqrt(-a^2 + b^2)*arctan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c
))) - (a^2*b - b^3)*sin(d*x + c))/((a^5 - 2*a^3*b^2 + a*b^4)*d*cos(d*x + c) + (a^4*b - 2*a^2*b^3 + b^5)*d)]

________________________________________________________________________________________

giac [A]  time = 0.24, size = 150, normalized size = 1.74 \[ -\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} a}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )} {\left (a^{2} - b^{2}\right )}}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="giac")

[Out]

-2*((pi*floor(1/2*(d*x + c)/pi + 1/2)*sgn(2*a - 2*b) + arctan((a*tan(1/2*d*x + 1/2*c) - b*tan(1/2*d*x + 1/2*c)
)/sqrt(-a^2 + b^2)))*a/((a^2 - b^2)*sqrt(-a^2 + b^2)) - b*tan(1/2*d*x + 1/2*c)/((a*tan(1/2*d*x + 1/2*c)^2 - b*
tan(1/2*d*x + 1/2*c)^2 - a - b)*(a^2 - b^2)))/d

________________________________________________________________________________________

maple [A]  time = 0.34, size = 118, normalized size = 1.37 \[ \frac {\frac {2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -a -b \right )}+\frac {2 a \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)/(a+b*sec(d*x+c))^2,x)

[Out]

1/d*(2*b/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(a*tan(1/2*d*x+1/2*c)^2-tan(1/2*d*x+1/2*c)^2*b-a-b)+2*a/(a-b)/(a+b)/((a-
b)*(a+b))^(1/2)*arctanh(tan(1/2*d*x+1/2*c)*(a-b)/((a-b)*(a+b))^(1/2)))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?`
 for more details)Is 4*a^2-4*b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 1.04, size = 92, normalized size = 1.07 \[ \frac {2\,a\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}-\frac {2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a+b\right )\,\left (a-b\right )\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)*(a + b/cos(c + d*x))^2),x)

[Out]

(2*a*atanh((tan(c/2 + (d*x)/2)*(a - b)^(1/2))/(a + b)^(1/2)))/(d*(a + b)^(3/2)*(a - b)^(3/2)) - (2*b*tan(c/2 +
 (d*x)/2))/(d*(a + b)*(a - b)*(a + b - tan(c/2 + (d*x)/2)^2*(a - b)))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\sec {\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+b*sec(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)/(a + b*sec(c + d*x))**2, x)

________________________________________________________________________________________